.TH REFLECXX-GEN 1 "2007/03/10" "Reflecxx @PACKAGE_VERSION@" "Reflecxx Commands Manual"
.OS
.SH NAME
reflecxx-gen \- Generate type information for C/C++ from debugging information
in object files.
.SH SYNOPSIS
.BI reflecxx-gen
[\fB-hVv\fR]
[\fB-e \fIextension\fR]
file1
[file2 ...]
.SH DESCRIPTION
The
.B reflecxx-gen
script generates basic type information for C/C++ from debugging information in
object files.  Type information is only generated when it is referenced in the
object files, so extraneous data will not be included. For example, if you
wanted to convert an enumerated value to a string, you would declare the type
and an external reference to the type information to be generated:
.PP
.RS
enum hw_enum_t { HELLO_WORLD };
.PD 0
.PP
extern struct reflecxx_full_type hw_enum_t_type_info;
.RE
.PD
.PP
Then, to convert the value, you would use the reflecxx_enum_by_value()
function:
.PP
.RS
en = reflecxx_enum_by_value(&hw_enum_t_type_info, HELLO_WORLD);
.PP
printf("%s\\n", en->ree_name);
.RE
.PD
.PP
After compiling this code, but before linking, you would run
.B reflecxx-gen
on the object file(s) to generate a '.c' file that contained the reflecxx data
structures.
.PP
Available options:
.P
.TP
\fB-h
Print out a usage message.
.TP
\fB-V
Print out the version number.
.TP
\fB-v
Increase verbosity, this is additive.  A single '-v' prints out internal
warnings and a second prints out trace information, useful for debugging.
.TP
\fB-e \fIextension
Specify the extension to use for the generated type data.  This value will be
appended to the actual type name.  The default value is
.I type_info.
.SH EXAMPLES
.PP
To generate the type information for the "Hello, World" example in the
introduction:
.RS
$ reflecxx-gen hello-world.o > hello-world-reflecxx-info.c
.RE
.SH SEE ALSO
objdump(1), python(1)
.SH NOTES
The Reflecxx project can be found on the web at
.IR http://code.google.com/p/reflecxx
